import React, { Component } from 'react'
import './forget.scss'
import { Toast } from 'antd-mobile'
export default class UserPass extends Component {
  constructor(props) {
    super(props)
    this.state = {
      inpVal: "",
    }
  }
  //返回上一步
  goToPrev = (params) => {
    this.props.history.go(-1)
  }
  handleClick = (params) => {
   if(this.state.inpVal===""){
    Toast.info("输入框不能为空", 1)
   }else{
    Toast.info("你忘记了我也没办法", 1)
   }
  }
  //受控表单
  valChange = (e) => {
    this.setState({
      inpVal: e.target.value.trim()
    })
  }

  render() {
    let { inpVal } = this.state
    return (
      <div className='mgUserPass'>
        <div className='mgUserPassNav'>
          <div className='Nav-left'>
            <i onClick={this.goToPrev} className='iconfont icon-icon'></i>
          </div>
          <div className='Nav-center'>
            找回密码
           </div>
          <div className='Nav-right'></div>
        </div>
        <div className='mgUserPassMain'>
          <div className='MainAccount'>
            <input
              value={inpVal}
              onChange={this.valChange}
              type="text" placeholder='用户名/邮箱/手机号' />
          </div>
          <div onClick={this.handleClick} className='MainLogin'>
            下一步
            </div>
        </div>
      </div>
    )
  }
}
